import 'package:flutter/material.dart';

class CustomTitle extends StatefulWidget {
  final double width;
  final double textSize;
  final String text;
   CustomTitle({Key key, this.width, this.textSize=40, this.text}) : super(key: key);
  @override
  _CustomTitleState createState() => _CustomTitleState();
}

class _CustomTitleState extends State<CustomTitle> {
  @override
  Widget build(BuildContext context) {

    return Container(
      height: 200,
      width: widget.width,
      child: Stack(
        children: [
          Positioned(
              left: ( widget.width - 400) / 2,
              top: 70,
              child: Container(
                  width: 400,
                  alignment: Alignment.center,
                  child: SelectableText(widget.text, style: TextStyle(
                    fontSize: widget.textSize,
                    color: Colors.black,
                    fontWeight: FontWeight.bold,
                  )))),
          Positioned(
            left: ( widget.width -  widget.width / 20) / 2,
            top: 150,
            child: Container(
              height: 5,
              alignment: Alignment.center,
              width:  widget.width / 20,
              color: Colors.blue,
            ),
          ),
        ],
      ),
    );
  }
}
